package com.ls.service.impl;

import com.ls.dao.CategoryDao;
import com.ls.entity.Category;
import com.ls.entity.JsonResult;
import com.ls.service.ICategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;



@Service("categoryService")
public class CategoryServiceImpl implements ICategoryService {
	@Autowired
	private CategoryDao dao;

	public JsonResult<List<Category>> findCategory() {
		JsonResult<List<Category>> result = new JsonResult<List<Category>>();
		List<Category> list = dao.findCategory();
		if (list != null) {
			result.setStatus(0);
			result.setData(list);
			return result;
		}
		result.setStatus(1);
		result.setMsg("查询category失败");
		return result;
	}

}
